<template>
  <div v-if="this.products.length">
    <Header></Header>
    <router-view></router-view>
    <!-- 底部 -->
    <Footer></Footer>
    <!-- 侧边咨询客服按钮 -->
    <consult-serve></consult-serve>
  </div>
</template>

<script>
import { mapActions, mapState } from "vuex";
import Header from "../components/Header.vue";
import Footer from "../components/Footer.vue";
import ConsultServe from "../components/ConsultServe.vue";
export default {
  computed: {
    ...mapState("products", ["products"]),
  },
  components: {
    Header,
    Footer,
    ConsultServe,
  },
  created() {
    this.getProducts();
  },
  methods: {
    ...mapActions("products", ["getProducts"]),
  },
};
</script>

<style>
</style>